@using Microsoft.AspNetCore.Authorization
@model PublishLaterPartViewModel

@inject IAuthorizationService AuthorizationService

<style asp-src="~/OrchardCore.PublishLater/Styles/publish-later.min.css" debug-src="~/OrchardCore.PublishLater/Styles/publish-later.css"></style>

@if (await AuthorizationService.AuthorizeAsync(User, OrchardCore.Contents.CommonPermissions.PublishContent, Model.ContentItem))
{
    <div class="btn-group">
        <input asp-for="ScheduledPublishLocalDateTime" type="datetime-local" class="form-control content-preview-select" />
        <button class="btn btn-primary btn-publish-later" type="submit" name="submit.Save" value="submit.PublishLater">@T["Publish Later"]</button>
    </div>
    @if (Model.ScheduledPublishUtc.HasValue)
    {
        <div class="btn-group">
            <button class="btn btn-primary btn-publish-later" type="submit" name="submit.Save" value="submit.CancelPublishLater">@T["Cancel Publish Later"]</button>
        </div>
    }
}
